package com.simon.hse.activity.safe.safework;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.simon.hse.R;
import com.simon.hse.activity.BaseActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;

/**
 * 安全作业方案
 */
@SuppressWarnings("all")
@ContentView(R.layout.activity_safe_work)
public class SafeWorkActivity extends BaseActivity {
    @ViewInject(R.id.tv_common_title)
    TextView mTv_common_title;

    @ViewInject(R.id.iv_common_right)
    ImageView mIv_common_right;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mIv_common_right.setImageResource(R.mipmap.tab_add_icon);
        mTv_common_title.setText("安全作业方案");
    }

    @Event(value = {R.id.iv_common_left, R.id.iv_common_right})
    private void back(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.iv_common_left:
                finish();
                break;
            case R.id.iv_common_right:
                startActivity(new Intent(SafeWorkActivity.this, WorkSafePlanApplyActivity.class));
                break;
        }
    }

    @Event(value = {R.id.ll_safe_work_query, R.id.ll_safe_work_approval, R.id.ll_safe_work_cancel})
    private void clickFunction(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.ll_safe_work_query:
                intent.setClass(SafeWorkActivity.this, SafeWorkQueryActivity.class);
                break;
            case R.id.ll_safe_work_approval:
                intent.setClass(SafeWorkActivity.this, SafeWorkAprovalActivity.class);
                break;
            case R.id.ll_safe_work_cancel:
                intent.setClass(SafeWorkActivity.this, SafeWorkCancelActivity.class);
                break;
        }
        startActivity(intent);
    }
}
